package com.solo.system.dubbo;

import cn.hutool.core.lang.tree.Tree;
import com.solo.system.api.SysDeptApi;
import com.solo.system.service.SysDeptService;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

/**
 * 系统部门远程调用实现类
 * @author 十一
 * @since 2024/11/11
 * 人生若只如初见，何事秋风悲画扇
 **/
@Service
@DubboService
@RequiredArgsConstructor
public class SysDeptApiImpl implements SysDeptApi {
    
    private final SysDeptService sysDeptService;
    
    @Override
    public List<Tree<Long>> selectDeptTree() {
        return sysDeptService.selectDeptTree();
    }
    
    public Set<Long> selectChildDeptIds(Long deptId) {
        return sysDeptService.selectChildDeptIds(deptId, true);
    }

}
